<template>
  <div class="preWorkBox">
    <!-- 安规测试结果 -->
    <div class="content">
      <div class="contentDiv">
        <h1 style="margin-left:40%">产品安规测试结果</h1>
        
        <el-form
          ref="form"
          class="perForm"
          :model="form"
          label-width="120px"
          size="medium"
          :inline="true"
          style="margin-top: 30px"
        >
          <el-row>
            <el-form-item label="整机条码" prop="completeMachineCode">
              <el-input
                v-model="form.completeMachineCode"
                type="textarea"
                placeholder="输入整机条码"
                :rows="3"
                style="width: 400px;"
                @change="getData"
              />
            </el-form-item>
          </el-row>
          
          <el-form-item label="整机条码" prop="caseId">
            <el-input v-model="form.caseId" :disabled="true"/>
          </el-form-item>
          <el-form-item label="产线号" prop="lineId">
            <el-input v-model="form.lineId" :disabled="true"/>
          </el-form-item>
          <el-form-item label="老化房号" prop="burninId">
            <el-input v-model="form.burninId" :disabled="true"/>
          </el-form-item>
          <el-form-item label="调试台号" prop="testId">
            <el-input v-model="form.testId" :disabled="true"/>
          </el-form-item>
          <el-form-item label="产品型号" prop="productStandard">
            <el-input v-model="form.productStandard" :disabled="true"/>
          </el-form-item>
          <el-form-item label="生产批号" prop="taskId">
            <el-input v-model="form.taskId" :disabled="true"/>
          </el-form-item>
          <el-form-item label="质检员" prop="inspectName">
            <el-input v-model="form.inspectName" :disabled="true"/>
          </el-form-item>
          <el-form-item label="老化人员" prop="agingName">
            <el-input v-model="form.agingName" :disabled="true"/>
          </el-form-item>
          <el-form-item label="调试人员" prop="debugName">
            <el-input v-model="form.debugName" :disabled="true"/>
          </el-form-item>
          <el-form-item label="客户名称" prop="customer">
            <el-input v-model="form.customer" :disabled="true"/>
          </el-form-item>
          <el-form-item label="产品类型" prop="productType">
            <el-input v-model="form.productType" :disabled="true"/>
          </el-form-item>
          <el-form-item label="质检结果" prop="inspectResult">
            <el-input v-model="form.inspectResult" :disabled="true"/>
          </el-form-item>
          <el-form-item label="老化结果" prop="ageingResult">
            <el-input v-model="form.ageingResult" :disabled="true"/>
          </el-form-item>
          <el-form-item label="调试结果" prop="debugResult">
            <el-input v-model="form.debugResult" :disabled="true"/>
          </el-form-item>
        </el-form>

        <el-tag size="large" style="font-size: 20px;">组装质检信息</el-tag>
        <el-table  :data="assembleList" width="80%">
            <el-table-column label="物料编码" align="center" prop="materialId" />
            <el-table-column label="物料名称" align="center" prop="materialName" />
            <el-table-column label="物料规格" align="center" prop="materialStandard" />
            <el-table-column label="批次流水号" align="center" prop="materialBatch" />
            <el-table-column label="安装时间" align="center" prop="installTime" />
            <el-table-column label="装配员" align="center" prop="installName" />
            <!-- <el-table-column label="检测日期" align="center" prop="inspectDate" width="180">
                <template slot-scope="scope">
                <span>{{ parseTime(scope.row.inspectDate, '{y}-{m}-{d}') }}</span>
                </template>
            </el-table-column> -->
        </el-table>


        <el-tag size="large" style="font-size: 20px;">安规测试结果</el-tag>
        <el-form
          ref="regulationsResults"
          class="perForm"
          :model="regulationsResults"
          label-width="120px"
          size="medium"
          :inline="true"
          style="margin-top: 15px"
        >
            <el-form-item label="耐压值上限(mA)" prop="pressureValueUp">
                <el-input v-model="regulationsResults.pressureValueUp" :disabled="true"/>
            </el-form-item>
            <el-form-item label="耐压值下限(mA)" prop="pressureValueDown">
                <el-input v-model="regulationsResults.pressureValueDown" :disabled="true"/>
            </el-form-item>
            <el-form-item label="耐压值实测(mA)" prop="pressureTestValue">
                <el-input v-model="regulationsResults.pressureTestValue" :disabled="true"/>
            </el-form-item>
            <el-form-item label="绝缘值上限(兆欧)" prop="insulationValueUp">
                <el-input v-model="regulationsResults.insulationValueUp" :disabled="true"/>
            </el-form-item>
            <el-form-item label="绝缘值下限(兆欧)" prop="insulationValueDown">
                <el-input v-model="regulationsResults.insulationValueDown" :disabled="true"/>
            </el-form-item>
            <el-form-item label="绝缘值实测(兆欧)" prop="insulationValue">
                <el-input v-model="regulationsResults.insulationValue" :disabled="true"/>
            </el-form-item>
            <el-form-item label="安规测试结果" prop="passorNot">
                <el-input v-model="regulationsResults.passorNot" :disabled="true"/>
            </el-form-item>
            <el-form-item label="测试时间" prop="testTime">
                <el-input v-model="regulationsResults.testTime" :disabled="true"/>
            </el-form-item>
            <el-form-item label="测试员" prop="testPerson">
                <el-input v-model="regulationsResults.testPerson" :disabled="true"/>
            </el-form-item>
        </el-form>


        <el-tag size="large" style="font-size: 20px;">维修记录</el-tag>
        <el-table  :data="maintenanceRecords" width="80%">
              <el-table-column label="维修时间" align="center" prop="faultTime" />
              <el-table-column label="维修人" align="center" prop="faultName" />
              <el-table-column label="送修时间" align="center" prop="giveTime" />
              <el-table-column label="送修人" align="center" prop="giveName" />
              <el-table-column label="故障类型" align="center" prop="faultType" />
              <el-table-column label="故障定位" align="center" prop="faultPosition" />
              <el-table-column label="失效分析人" align="center" prop="analysisName" />
              <el-table-column label="装配线" align="center" prop="lineNumber" />
          </el-table>


      </div>
    </div>
  </div>
</template>

<script>
import { regulationData} from "@/api/apppro/index";
export default {
  name: "assemble",
  data() {
    return {
      //头部表单
      form: {},
      //安规测试结果
      regulationsResults:{},
      //灌流测试结果
      //perfusionResults:{},
      //维修记录
      maintenanceRecords:[],
      // loading: false,
      // templateList: []
      //组装质检信息table
      assembleList:[]
    };
  },
  created() {},
  methods: {
    //输入整机条码事件
    getData(){
      // this.form.completeMachineCode = "1056862023091100210820005380019"
      let params ={
        caseId:this.form.completeMachineCode
      }
      regulationData(params).then(res=>{
        console.log(res,'整机条码res');
        if(res.code == 200){
          if(res.data.caseInfo){
            this.form = res.data.caseInfo
          }
          if(res.data.modelInstallList){
            this.assembleList = res.data.modelInstallList
          }
          if(res.data.pressureTest){
            this.regulationsResults =res.data.pressureTest
          }
          if(res.data.maintenanceRecordList){
            this.maintenanceRecords =res.data.maintenanceRecordList
          }
        }
      })
    },
    //submitForm() {},
  },
};
</script>
<style lang="scss" scoped>
.contentDiv {
  width: 1350px;
}
</style>